package com.lz.gmall.common.result;

import lombok.Getter;


/**
 * 统一返回结果状态信息类
 *
 * @author 郭运龙
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"成功"),
    FAIL(201, "失败"),
    SERVICE_ERROR(2012, "服务异常"),

    SYSTEM_ERROR(99999,"网络异常"),
    REF_SPU_ERROR(110010 , "存在SPU的引用，删除品牌失败"),
    REF_SKU_ERROR(110020 , "存在SKU的引用，删除品牌失败"),
    REDIS_ATTACK_ERROR(100300 , "非法数据请求"),

    CART_NUM_ERROR(6798,"购物车数量超出最大限制"),

    LOGIN_ERROR(22011,"账户或密码错误"),

    PAY_RUN(205, "支付中"),

    LOGIN_AUTH(208, "未登陆"),
    PERMISSION(209, "没有权限"),
    SECKILL_NO_START(210, "秒杀还没开始"),
    SECKILL_RUN(211, "正在排队中"),
    SECKILL_NO_PAY_ORDER(212, "您有未支付的订单"),
    SECKILL_FINISH(213, "已售罄"),
    SECKILL_END(214, "秒杀已结束"),
    SECKILL_SUCCESS(215, "抢单成功"),
    SECKILL_FAIL(216, "抢单失败"),
    SECKILL_ILLEGAL(217, "请求不合法"),
    SECKILL_ORDER_SUCCESS(218, "下单成功"),
    COUPON_GET(220, "优惠券已经领取"),
    COUPON_LIMIT_GET(221, "优惠券已发放完毕"),
    REQ_REPEAT(22090,"请不要重复提交"),

    SKU_PRICE_CHANGE(22009, "价格发生了变化，请重新查看购物车"),
    SKU_STOCK_CHANGE(22119, "商品已经卖完了，请重新查看购物车"),

    WARE_ERROR(111111,"扣减商品失败了");
    ;
    private Integer code;

    private String message;

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
